package tk.mybatis.springboot.model;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import tk.mybatis.springboot.share.util.PropertiesUtil;

public class SimulateApiReqMsg implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -1770810435464684204L;

	private final String operType = "SIMULATE";
	
	private String msg = "参考报价";
	
	private String sendTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
	
	private String sign = "";
	
	private Map<String, Object> data = new HashMap<String, Object>();
	
	public SimulateApiReqMsg(){
		
	}

	public static SimulateApiReqMsg buildMessage(CarInfo carInfo, String insurerCode, String biBeginDate
			, String ciBeginDate, String cityCode, List<Coverage> coverageList){
		SimulateApiReqMsg msg = new SimulateApiReqMsg();
		msg.data.put("applicationID", PropertiesUtil.getMessage("application_id"));
		msg.data.put("carInfo", carInfo);
		msg.data.put("insurerCode", insurerCode);
		msg.data.put("biBeginDate", biBeginDate);
		msg.data.put("ciBeginDate", ciBeginDate);
		msg.data.put("cityCode", cityCode);
		msg.data.put("CoverageList", coverageList);
		return msg;
	}
	
	public static void buildMessageByCar(CarInfo carInfo, SimulateApiReqMsg msg){
		msg.data.put("carInfo", carInfo);
	}
	
	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getSendTime() {
		return sendTime;
	}

	public void setSendTime(String sendTime) {
		this.sendTime = sendTime;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	public String getOperType() {
		return operType;
	}

	public Map<String, Object> getData() {
		return data;
	}

	public void setData(Map<String, Object> data) {
		this.data = data;
	}
	
}
